# locust777

//------------------------------------------------------------------------------------------------------------------------

//冒泡排序
//定义一个数组，输入十个数，按从小到大排序，输出
//#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<windows.h>

int main()
{
//定义
	//int arr[10] = {0};
	//int i,num;
//输入
	//for(i = 0;i < 10;i++)
	//{
	//	scanf("%d",&num);
	//	arr[i] = num;
	//}   //得到arr[]十个元素
	int i = 0;
	int arr[10] = {10,9,8,7,6,5,4,3,2,1};
//排序
	int j,k;
	for(k = 0;k < 9;k++)
	{
		for(j = 0;j < 10 - 1 - k;j++)
		{
			if(arr[j] > arr[j+1])
			{
				int tmp = arr[j];
				arr[j] = arr[j+1];
				arr[j+1] = tmp;
			}
		}
	}

//输出
	for(i = 0;i<10;i++)
	{
		printf("%d ",arr[i]); //1 2 3 4 5 6 7 8 9 10
	}
	printf("\n");
system("pause");
return 0;
}

